<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,user-scalable=no,minimal-ui">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../img/favicon.ico">
    <title>健康档案详情</title>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="../plugins/element-ui/lib/theme-chalk/index.css">
    <link rel="stylesheet" href="../css/page-health-recordDetail.css"/>
    <!-- 引入组件库 -->
    <script type="text/javascript" src="../js/main.js"></script>
    <script type="text/javascript" src="../plugins/vue/vue.js"></script>
    <script type="text/javascript" src="../plugins/element-ui/lib/index.js"></script>
    <script type="text/javascript" src="../plugins/jquery/dist/jquery.min.js"></script>
    <script type="text/javascript" src="../plugins/vue/axios-0.18.0.js"></script>
</head>

<body data-spy="scroll" data-target="#myNavbar" data-offset="150">
<div id="app">
    <!-- 页面头部 -->
    <div class="top-header">
        <span class="f-left"><i class="icon-back" onclick="history.go(-1)"></i></span>
        <span class="center">关爱健康</span>
        <span class="f-right"><i class="icon-more"></i></span>
    </div>
    <!-- 页面内容 -->
    <div class="contentBox">
        <div class="list-content">
            <div class="fix-info">
                <ul class="list-unstyled">
                    <li><span class="tit">档案号</span><span class="info">{{formData.fileNumber}}</span></li>
                    <li><span class="tit">姓名</span><span class="info">{{formData.name}}</span></li>
                    <li><span class="tit">性别</span><span class="info">{{formData.sex}}</span></li>
                    <li><span class="tit">身份证号</span><span class="info">{{formData.idCard}}</span></li>
                    <li><span class="tit">手机号</span><span class="info">{{formData.phoneNumber}}</span></li>
                </ul>
            </div>
            <div class="fix-info">
                <ul class="mui-list-unstyled ">
                    <li><span class="tit">生日</span><span class="info">{{formData.birthday}}</span></li>
                    <li><span class="tit">注册时间</span><span class="info">{{formData.regTime}}</span></li>
                </ul>
            </div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">
    var vue = new Vue({
        el: '#app',
        data: {
            formData: {},//表单数据
        },
        //钩子函数，VUE对象初始化完成后自动执行
        created() {
            var value = getCooikePhone();
            if (value==="-1"){
                this.$message.error("出现获取手机号错误，请重新登录！");
                setTimeout( function(){
                    location.href="/pages/login.html";
                }, 2 * 1000 );
                return false;
            }else{
                axios.post("/index/findMemberByPhone.do?phone=" + value).then((res) => {
                    if (res.data.flag) {
                        //弹出成功提示信息
                        // this.$message.success(res.data.message);
                        this.formData = res.data.data;
                        if (res.data.data['sex'] == 0) {
                            this.formData['sex'] = '未知'
                        } else if (res.data.data['sex'] == 1) {
                            this.formData['sex'] = '男'
                        } else {
                            this.formData['sex'] = '女'
                        }
                    } else {
                        //执行失败
                        this.$message.error(res.data.message);
                    }
                });
            }

        }
    });
</script>
</html>